# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-preshed
pkgver=3.0.6
pkgrel=0
pkgdesc="Cython hash tables that assume keys are pre-hashed"
url="https://github.com/explosion/preshed"
arch="all"
license="MIT"
depends="python3 py3-cymem py3-murmurhash"
makedepends="python3-dev py3-setuptools cython"
checkdepends="py3-pytest"
subpackages="$pkgname-doc"
source="preshed-$pkgver.tar.gz::https://github.com/explosion/preshed/archive/v$pkgver.tar.gz"
builddir="$srcdir/preshed-$pkgver"

build() {
	python3 setup.py build
}

check() {
	python3 setup.py install --root="$PWD/tmp_install"

	cd tmp_install/$(python3 -c "import site; print(site.getsitepackages()[0])")


	PYTHONPATH="$PWD/usr/lib" \
		pytest-3 preshed
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}

sha512sums="
5b9ba00dc57c2dfbdcadd3269cf7ba1df8f9a00215f5e6304a2a2c721e3458f2d9e3d8450d500a8c0f65e2f03fcb05ccc2b4e6d579faf74054644e82a87114a4  preshed-3.0.6.tar.gz
"
